<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template_layout_lrt.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<style>
.ui-dialog {
	top: 100px !important;
}

.col-md-9 .box-header {
	height: 0px;
	padding: 0px;
	margin: 0px;
}

.box-body {
	padding-top: 1px !important;
}

.col-md-9 .slimScrollDiv {
	height: 750px !important;
}
</style>
	</ui:define>
	<ui:define name="top-box-tools">
		<h:form id="btnForm">
			<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
				<p:commandButton value="是" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
				<p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
			</p:confirmDialog>
			<p:toolbar id="toolbar">
				<f:facet name="left">
					<p:growl id="msgs" showDetail="true" />
					<p:commandButton id="configButton" value="配置" oncomplete="PF('configDlg').show()"
						disabled="#{adminMobileMessController.selectedNode == null}" update="dialogForm:configDlg"
						actionListener="#{adminMobileMessController.initMessageTypeMap}" />
				</f:facet>
			</p:toolbar>
		</h:form>
	</ui:define>
	<ui:define name="left-box-title">
		&nbsp;组织机构
	</ui:define>
	<ui:define name="left-box-body">
		<h:form id="leftForm">
			<p:tree value="#{adminMobileMessController.root}" var="node" dynamic="true" id="tree"
				widgetVar="tree" selectionMode="single" selection="#{adminMobileMessController.selectedNode}"
				style="border:0">
				<p:ajax event="expand" listener="#{adminMobileMessController.onNodeExpand}" update="tree" />
				<p:ajax event="select" listener="#{adminMobileMessController.onNodeSelect}"
					update="rightForm:table btnForm:toolbar" />
				<p:treeNode type="dept" icon="fa fa-home">
					<h:outputText value="#{node}" />
				</p:treeNode>
				<p:treeNode type="personnel" icon="fa fa-user">
					<h:outputText value="#{node}" />
				</p:treeNode>
				<p:treeNode type="personnelr" icon="fa  fa-user">
					<h:outputText value="#{node}" />
				</p:treeNode>
			</p:tree>
		</h:form>
	</ui:define>
	<ui:define name="right-box-body">
		<h:form id="rightForm">
			<p:dataTable id="table" widgetVar="table" var="item"
				value="#{adminMobileMessController.messageConfigList}" emptyMessage="无记录">
				<p:column headerText="人员名称" groupRow="true">
					<p:outputLabel value="#{item.receiverId}" />
				</p:column>
				<p:column headerText="接收范围">
					<p:outputLabel value="#{adminMobileMessController.getTypeDescription(item.msgTypeId)}" />
				</p:column>
				<p:column headerText="接收消息类型">
					<p:outputLabel value="#{adminMobileMessController.getReceiveDescription(item.msgSenderId)}" />
				</p:column>
			</p:dataTable>
		</h:form>
		<h:form id="dialogForm">
			<p:dialog widgetVar="configDlg" id="configDlg" header="接收消息设置" modal="true" width="1200"
				height="700">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk"
							update="rightForm:table btnForm:msgs btnForm:toolbar" oncomplete="PF('configDlg').hide();"
							actionListener="#{adminMobileMessController.saveConfigMessage}" />
					</f:facet>
				</p:toolbar>
				<p:dataTable id="configTable" widgetVar="configTable" var="item"
					value="#{adminMobileMessController.allTypeList}" emptyMessage="无记录">
					<p:column>
						<p:outputLabel value="#{item.msgType.description}" />
					</p:column>
					<p:column headerText="接收方式">
						<p:selectManyCheckbox id="basic" value="#{item.rec}">
							<f:selectItems value="#{adminMobileMessController.recString}" var="rec"
								itemLabel="#{adminMobileMessController.getReceiveDescription(rec)}" itemValue="#{rec}" />
						</p:selectManyCheckbox>
					</p:column>
				</p:dataTable>
			</p:dialog>
		</h:form>
	</ui:define>
	<ui:define name="contentend">

	</ui:define>
</ui:composition>